package cn.maihe.elg.operation.model.enums;

import java.util.Arrays;

/**
 * @Description 项目适用保函模板类型
 * @Author WJH
 * @Date 2022/03/09
 */
public enum GuaranteeTemplateType {
    defaultTemp(0L, "03担保保函文件模板.docx",1,68F,217F-40,115F,223F-40,"泉州丰泽得兴融资担保有限公司（公章）","（签字"),
    fangjian(1L, "04房建施工保函模板.docx",1,68F,197F-40,115F,223F-40,"泉州丰泽得兴融资担保有限公司（公章）","（签字"),
    putonggonglushigong(2L, "04普通公路施工(2020).docx",0,58F,130F,105F,150F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    shuili(3L, "04水利工程(2019)保函模板.docx",0,78F,170F,125F,190F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    jianli(4L, "04房建监理投标保证金银行保函模板.docx",0,140F,160F,100F,180F,"",""),
    gonglushigongjianli(5L, "04公路施工监理(2020).docx",0,120F,140F,80F,160F,"",""),
    gongluyanhushigong(6L, "04公路养护施工(2020).docx",0,120F,140F,80F,160F,"",""),
    fangjian2023(7L, "04房建施工(2023).docx",1,68F,177F,115F,193F,"泉州丰泽得兴融资担保有限公司（公章）","（签字"),
    fangjianjianli(8L, "04房建市政(监理)2018.docx",0,68F,172F,115F,188F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    shuili2023(9L, "04水利工程(2023)保函模板.docx",1,58F,90F,105F,98F,"泉州丰泽得兴融资担保有限公司（","或盖章）"),
    fangjianjianli2023(10L, "04房建市政监理（2023）.docx",0,68F,164F,115F,180F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    gongluyanghu(11L, "04公路养护.docx",0,93F,130F,140F,150F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    putonggonglushigong2023(12L, "04公路施工(2023).docx",0,83F,172F,130F,188F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    gonglushigongjianli2023(13L, "04公路施工监理(2023).docx",0,90F,145F,140F,155F,"担保人名称：泉州丰泽得兴融资担保有限公司","或盖章）"),
    Landscaping2017(14L, "04园林绿化（2017）.docx",0,68F,164F,115F,180F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    GeneralHighwayConstruction2023(15L, "04普通公路施工2023-2.docx",0,68F,164F,115F,180F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    meishanGuaranteeTemplate(16L, "眉山投标电子保函合作协议(担保).docx",4,120F,40F,115F,223F-40,"泉州丰泽得兴融资担保有限公司（盖章）","（签字）"),
    StandardDesign(17L, "04标准设计模板.docx",0,68F,164F,115F,180F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    xiaMenFangJianShiGong(18L, "厦门-房建施工.docx",1,68F,177F,115F,193F,"泉州丰泽得兴融资担保有限公司（公章）","（签字"),
    xiaMenFangJianShiZhengJianLi(19L, "厦门-房建市政监理.docx",0,68F,164F-35,115F,180-35F,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    xiaMenFangJianShiZhengJianLiPingDingFenLi(20L, "厦门-房建市政监理（评定分离）.docx",0,68F,164F-20,115F,180F-20,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    xiaMenGongluJianLiYinHang(21L, "厦门-公路监理（银行版）.docx",0,68F,164F-60,115F,180F-60,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    xiaMenShuiLiPingDingFenLi(22L, "厦门-水利（评定分离）.docx",0,68F,164F-20,115F,180F-20,"担保人名称：泉州丰泽得兴融资担保有限公司","（签字"),
    guoGuSuiXingTemp(100L, "03新疆国谷随行担保保函文件模板.docx",1,68F,217F-40,115F,223F-40,"泉州丰泽得兴融资担保有限公司（公章）","（签字"),
    guoGuSuiXingZhuGongChengTemp(101L, "01新疆国谷随行住建施工投标保函模板.docx",2,68F,217F-177,115F,223F-177,"泉州丰泽得兴融资担保有限公司（公章）","（签字"),
    ;

    GuaranteeTemplateType(Long templateId, String templateFileName, Integer signPageNum, Float signOrgXpx, Float signOrgYpx, Float signLegalXpx, Float signLegalYpx, String orgKey, String leagalKey) {
        this.templateId = templateId;
        this.templateFileName = templateFileName;
        this.signPageNum = signPageNum;
        this.signOrgXpx = signOrgXpx;
        this.signOrgYpx = signOrgYpx;
        this.signLegalXpx = signLegalXpx;
        this.signLegalYpx = signLegalYpx;
        this.orgKey = orgKey;
        this.leagalKey = leagalKey;
    }

    /**模板id */
    private Long templateId;
    /**
     * 模板文件名称：
     * 固定存放在resource/template/fileName
     * 1= 04房建投标保证金银行保函模板.docx
     * 2= 04公路投标保证金银行保函模板.docx
     * 3= 04水利投标保证金银行保函模板.docx
     * */
    private String templateFileName;

    /**
     * 签章图片所在签章文件的签章页码 0第一页 -1所有页 -2最后页
     */
    private Integer signPageNum;
    /**
     * 公司印章X轴坐标
     */
    private Float signOrgXpx;
    /**
     * 公司印章Y轴坐标
     */
    private Float signOrgYpx;
    /**
     * 法人印章X轴坐标
     */
    private Float signLegalXpx;
    /**
     * 法人印章Y轴坐标
     */
    private Float signLegalYpx;

    private String orgKey;
    private String leagalKey;

    public Long getTemplateId() {
        return templateId;
    }

    public String getTemplateFileName() {
        return templateFileName;
    }

    public Integer getSignPageNum() {
        return signPageNum;
    }

    public Float getSignOrgXpx() {
        return signOrgXpx;
    }

    public Float getSignOrgYpx() {
        return signOrgYpx;
    }

    public Float getSignLegalXpx() {
        return signLegalXpx;
    }

    public Float getSignLegalYpx() {
        return signLegalYpx;
    }

    public String getOrgKey() {
        return orgKey;
    }

    public String getLeagalKey() {
        return leagalKey;
    }

    public static GuaranteeTemplateType resolve(Long templateId) {
        return Arrays.stream(values()).filter(o -> o.getTemplateId().longValue() == templateId).findFirst().orElseThrow(() -> new RuntimeException("暂不支持保函模板Id"));
    }
}
